import { defineStore } from 'pinia'
import { fnGetDramaDatas,fnGetDetailDatas } from '@/axios/api'
export const useDramaStorage = defineStore('Drama', () => {
  const aAnimeDatas = ref([])
  const bLoading = ref(false)
  const fnGetAnimeDatas = async () => {
    bLoading.value = true
    aAnimeDatas.value = await fnGetDramaDatas()
    bLoading.value = false
  }
  fnGetAnimeDatas()
  const fnfetchAnimeDetail = async (id) => {
    bLoading.value = true
    aAnimeDatas.value = await fnGetDetailDatas(id)
    bLoading.value = false
  }
  return {
    bLoading,
    aAnimeDatas,
    fnfetchAnimeDetail
  }
})